<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>IPv4 vs IPv6：互联网协议的演进之路</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        
        .text-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            margin-top: -0.2rem;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        
        .section-divider {
            position: relative;
            text-align: center;
            margin: 4rem 0;
        }
        
        .section-divider::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(to right, transparent, #e0e0e0, transparent);
        }
        
        .section-divider i {
            position: relative;
            background: white;
            padding: 0 1rem;
            color: #667eea;
        }
        
        .feature-icon {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-size: 1.5rem;
            margin-bottom: 1rem;
        }
        
        .timeline-item {
            position: relative;
            padding-left: 3rem;
            margin-bottom: 2rem;
        }
        
        .timeline-item::before {
            content: '';
            position: absolute;
            left: 0.75rem;
            top: 2rem;
            bottom: -2rem;
            width: 2px;
            background: #e0e0e0;
        }
        
        .timeline-item:last-child::before {
            display: none;
        }
        
        .timeline-dot {
            position: absolute;
            left: 0;
            top: 0.5rem;
            width: 1.5rem;
            height: 1.5rem;
            border-radius: 50%;
            background: white;
            border: 3px solid #667eea;
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center animate-fadeInUp">
            <h1 class="text-5xl md:text-6xl font-bold mb-6">
                IPv4 vs IPv6
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">
                互联网协议的演进之路
            </p>
            <div class="flex justify-center space-x-8 text-lg">
                <div class="flex items-center">
                    <i class="fas fa-network-wired mr-2"></i>
                    <span>40亿地址 → 340涧地址</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-shield-alt mr-2"></i>
                    <span>安全升级</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-rocket mr-2"></i>
                    <span>性能优化</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-6 py-12">
        <!-- Introduction -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover">
            <h2 class="text-3xl font-bold mb-6 text-gray-800">
                <i class="fas fa-globe-asia mr-3 text-gradient"></i>前言
            </h2>
            <p class="text-lg leading-relaxed text-gray-700">
                <span class="drop-cap">I</span>P协议（互联网协议）是互联网协议群（IPS）中最重要的通信协议之一，其主要用于网络设备（如计算机、电脑、单个网络或一系列互连网络的以太网交换机）数据包的寻址和路由选择，并负责将其从一个网络转发到另一个网络。目前IP协议具备IPv4和IPv6两个版本，相信很多人对它俩并不熟知，更加不清楚IPv4和IPv6有什么区别。
            </p>
        </section>

        <!-- IPv4 Section -->
        <section class="grid md:grid-cols-2 gap-8 mb-12">
            <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                <div class="feature-icon">
                    <i class="fas fa-server"></i>
                </div>
                <h2 class="text-3xl font-bold mb-6 text-gray-800">IPv4地址</h2>
                <p class="text-gray-700 leading-relaxed mb-4">
                    IPv4地址的概念是在1980年代初期提出的。即使有新版本的IP地址，IPv4地址仍然是Internet用户使用最广泛的地址。通常，IPv4地址以<strong class="text-purple-600">点分十进制</strong>表示。每个部分代表一组构成8位地址方案的8位地址。
                </p>
                <div class="bg-purple-50 rounded-lg p-4 mb-4">
                    <p class="text-sm text-purple-800">
                        <i class="fas fa-info-circle mr-2"></i>
                        示例：192.168.1.1
                    </p>
                </div>
                <p class="text-gray-700 leading-relaxed">
                    IPv4地址组合的数量是有限的。总体而言，可以算出40亿<strong>（256⁴）</strong>个唯一地址。在IPv4地址才开始时，这个数字似乎永远不会过期。但是，现在情况有所不同了。
                </p>
            </div>
            
            <div class="bg-gradient-to-br from-purple-50 to-pink-50 rounded-2xl p-8 card-hover">
                <h3 class="text-2xl font-bold mb-4 text-gray-800">
                    <i class="fas fa-exclamation-triangle mr-2 text-yellow-500"></i>
                    IPv4地址枯竭危机
                </h3>
                <div class="timeline-item">
                    <div class="timeline-dot"></div>
                    <div>
                        <p class="font-semibold text-purple-700">2011年</p>
                        <p class="text-gray-600">IANA分发了IPv4地址空间的最后一块</p>
                    </div>
                </div>
                <div class="timeline-item">
                    <div class="timeline-dot"></div>
                    <div>
                        <p class="font-semibold text-purple-700">2015年</p>
                        <p class="text-gray-600">IANA正式宣布美国已用完IPv4地址</p>
                    </div>
                </div>
                <div class="timeline-item">
                    <div class="timeline-dot"></div>
                    <div>
                        <p class="font-semibold text-purple-700">现在</p>
                        <p class="text-gray-600">IPv4仍承载着超过90%的互联网流量</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Section Divider -->
        <div class="section-divider">
            <i class="fas fa-exchange-alt text-2xl"></i>
        </div>

        <!-- IPv6 Section -->
        <section class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover">
            <div class="flex items-center mb-6">
                <div class="feature-icon mr-4">
                    <i class="fas fa-rocket"></i>
                </div>
                <h2 class="text-3xl font-bold text-gray-800">IPv6地址</h2>
            </div>
            <div class="grid md:grid-cols-2 gap-6">
                <div>
                    <p class="text-gray-700 leading-relaxed mb-4">
                        它是Internet协议的最新版本，但它是在1998年开发的，旨在替换IPv4地址。IPv6地址使用以冒号分隔的十六进制数字。它分为八个16位块，构成一个128位地址方案。
                    </p>
                    <div class="bg-blue-50 rounded-lg p-4">
                        <p class="text-sm text-blue-800">
                            <i class="fas fa-info-circle mr-2"></i>
                            示例：2001:0db8:85a3:0000:0000:8a2e:0370:7334
                        </p>
                    </div>
                </div>
                <div class="bg-gradient-to-r from-blue-500 to-purple-600 text-white rounded-lg p-6">
                    <h4 class="text-xl font-bold mb-3">
                        <i class="fas fa-infinity mr-2"></i>几乎无限的地址空间
                    </h4>
                    <p class="text-3xl font-bold mb-2">3.4×10³⁸</p>
                    <p class="text-sm opacity-90">个可用地址，足够为地球上每一粒沙子分配一个IP地址</p>
                </div>
            </div>
        </section>

        <!-- Comparison Section -->
        <section class="mb-12">
            <h2 class="text-3xl font-bold mb-8 text-center text-gray-800">
                <i class="fas fa-balance-scale mr-3 text-gradient"></i>
                IPv4和IPv6的核心差异
            </h2>
            
            <!-- Interactive Diagram -->
            <div class="bg-white rounded-2xl shadow-xl p-8 mb-8">
                <div class="mermaid">
                    graph TD
                        A[IP协议] --> B[IPv4]
                        A --> C[IPv6]
                        B --> D[32位地址]
                        B --> E[40亿地址]
                        B --> F[点分十进制]
                        B --> G[可选安全性]
                        C --> H[128位地址]
                        C --> I[3.4×10³⁸地址]
                        C --> J[十六进制]
                        C --> K[强制安全性]
                        
                        style A fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                        style B fill:#fbbf24,stroke:#fff,stroke-width:2px,color:#fff
                        style C fill:#10b981,stroke:#fff,stroke-width:2px,color:#fff
                </div>
            </div>
            
            <div class="grid md:grid-cols-3 gap-6">
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-map-marked-alt text-3xl text-purple-600 mr-3"></i>
                        <h3 class="text-xl font-bold">地址类型</h3>
                    </div>
                    <div class="space-y-2 text-sm">
                        <p class="text-gray-600"><strong>IPv4:</strong> 多播、广播、单播</p>
                        <p class="text-gray-600"><strong>IPv6:</strong> 任意广播、单播、多播</p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-box text-3xl text-blue-600 mr-3"></i>
                        <h3 class="text-xl font-bold">数据包大小</h3>
                    </div>
                    <div class="space-y-2 text-sm">
                        <p class="text-gray-600"><strong>IPv4:</strong> 最小576字节</p>
                        <p class="text-gray-600"><strong>IPv6:</strong> 最小1208字节</p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow